<%@ page language="java" contentType="text/html; charset=utf-8"%>   
<%@ taglib prefix="s" uri="/struts-tags" %>   
<%String pathPrefix = request.getContextPath();%>
<html>
    <head>
        <title>文件上传示例</title>         
    </head>
    <script type="text/javascript">
    	function check(){
    		var filestr = document.getElementById("upload").value;    		     	
    		if(filestr==""){
    	 	 	 alert("请选择需要上传的文件");
    	  		 return false;
    		}else{
    			var url = "<%=pathPrefix%>/com/cattsfot/user/doUpload.action";
    			document.forms[0].action = url;
    			document.forms[0].submit();
    		}   		 
    		 
    	}
    </script>
    <body>         
        <s:fielderror ></s:fielderror>
        <center>        
       	<h1>文件上传</h1>
        <s:form  method="POST" enctype="multipart/form-data">          
        选择文件：<input type="file" name="upload" size="30"/><br/>
	   文件备注：<textarea cols="26" rows=3 name="fileCaption"></textarea>
        <input type="button" value="上传" onclick="check()">
        </s:form>
        </center>
    </body>
</html>
